<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/denglu.css">
    <script src="js/jquery.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>

<body>
    <div class="header">
        <div class="headlf">
            <img src="imgs/logo.png" alt="">
        </div>
        <div class="headlfr">
            <p>买真酒</p>
            <p>就上酒仙网</p>
        </div>
        <div class="headrt">
            <p>欢迎来到酒仙网！</p>
            <a href="zhuce.html">免费注册</a>
            <a href="">帮助中心</a>
        </div>
    </div>
    <div class="banner">
        <div class="bd">
            <p>账号登录<b>|</b><a>手机动态密码登录</a></p>
            <input type="text" name="" class="txt" id="txt1" placeholder="用户名/邮箱/手机号"><span class="mm mm1"></span>
            <input type="password" name="" class="txt" id="txt2" placeholder="密码"><span class="mm mm2"></span>
            <input type="text" name="" class="txt" id="txt3" placeholder="验证码"><span class="mm mm3"></span>
            <p><a href="javascript:;" class="lg">登录</a></p>
            <p class="zc">
                <a href="">忘记密码</a>
                <a href="">免费注册</a>
            </p>
            <div class="tb">
                <b>使用合作账号登录</b>
                <a href=""></a>
                <a href=""></a>
                <a href=""></a>
                <a href=""></a>
            </div>
        </div>

    </div>

    <div class=" footer ">
        <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&copy
            酒仙网 2011 jiuxian.com All Rights Reserved 京ICP证110141号 京公网安备1101050188221</p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;购买前请确认达到法定饮酒年龄！酒仙网不销售任何含酒精产品给18岁以下人士！</p>
    </div>
    <script>
        var oInput = document.querySelectorAll("input")
        var oSpan = document.querySelectorAll("span")
        var reg = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/;
        oInput[0].onblur = function() {
            var val1 = oInput[0].value;
            if (reg.test(val1)) {
                oSpan[0].innerText = "格式正确";
            } else {
                oSpan[0].innerText = "格式错误";
            }
        }
        var reg1 = /^.*(?=.{6,})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/;
        oInput[1].onblur = function() {
            var val2 = oInput[1].value;
            if (reg1.test(val2)) {
                oSpan[1].innerText = "格式正确";
            } else {
                oSpan[1].innerText = "格式错误";
            }
        }
        var reg2 = /^[0-9]{1,20}$/;
        oInput[2].onblur = function() {
            var val3 = oInput[2].value;
            if (reg2.test(val3)) {
                oSpan[2].innerText = "格式正确";
            } else {
                oSpan[2].innerText = "格式错误";
            }
        }
        var oLg = document.querySelector(".lg")
        oLg.onclick = function() {
            $.get("http://jx.xuzhixiang.top/ap/api/login.php", {
                username: oInput[0].value,
                password: oInput[1].value,
            }).then((res) => {
                console.log(res);
                if (res.code == 1) {
                    function jump() {
                        localStorage.setItem("username", JSON.stringify(res.data))
                        location.href = "shouye.html"
                    }
                    jump();
                } else {
                    alert("请检查用户名或者密码")
                }
            });
        }
    </script>
</body>

</html>